function Bg(){
    this.bg_1;
    this.bg_2;
    this.loop;
    this.bgbox;
    this.offsetY = 0;
    this.loadimg();
}
Bg.prototype.loadimg = function(){
    this.bgbox = $('<div class="bgbox fix">');
    this.bg_1 = $('<img>');
    this.bg_2 = $('<img>');
    Game.width = Game.container.width();
    Game.height = Game.container.height();
    this.bg_1.attr('src','images/bg.jpg');
    this.bg_2.attr('src','images/bg.jpg');
    this.bg_1.css({'width':Game.width + 'px','height':Game.height + 'px'});
    this.bg_2.css({'width':Game.width + 'px','height':Game.height + 'px'});
    this.bgbox.append(this.bg_1);
    this.bgbox.append(this.bg_2);
    Game.container.append(this.bgbox);
    this.looper();
}
Bg.prototype.looper = function(){
    var self = this;
    function initanimate(){
        self.bgbox.css('bottom',1 + 'px');
        self.bgbox.animate({'bottom':-1 * Game.height + 'px'},1200,'linear',function(){
            initanimate();
        })
    }
    initanimate();
    // setTimeout(function(){
    //     self.stop();
    // },1000)
    
    
}
Bg.prototype.stop = function(){
    this.bgbox.stop();
}